Repository navigation
Conversation
…ueue read `.github/scripts/review-gate.mjs` built its `reports` rows in a third copy that had drifted from `enqueue-guard.mjs` and `merge-gate.mjs`: the review row carried no `id` (the handle a decision names), no `state` (`stopRequestAt` reads CHANGES_REQUESTED from it — the whole of a refusal a person writes without typing), a review whose body was empty was dropped, and a comment written on one line of the diff never reached the report at all. So this report could say PASS while the queue gate refused the same tip for a standing request. `reportsFrom` now builds all three faces once, and the conclusion readers skip `kind: 'review-comment'` through the one predicate `isConclusionSource`, which moves to `review-gate.mjs` (the module that owns what a conclusion is) and is re-exported by `enqueue-rules.mjs`, so both readers keep one definition and no import cycle is introduced. The three row builders are deliberately left in three places; merging them is a separate change.
Contributor
Author
|
@Birfy review request — tip
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(gates): give review-gate the same report rows the guard and the queue read
.github/scripts/review-gate.mjsbuilt itsreportsrows in a third copy of ashape that
enqueue-guard.mjs:67andmerge-gate.mjs:224had already beenfixed in (#2092, #2120). This copy drifted, and the report-only gate read a
different pull request than the queue gate does:
id— the handle a decision prints, and the oneconclusionAt/stopRequestAtanswer with;state— a review that asks for changes and carries no body is thewhole of what a person writes there ("Request changes" is a button), and
stopRequestAt(enqueue-rules.mjs) reads exactly that state asasked for changes;is a third place a person can ask not to merge (Read a stop request written on a review comment line #2091).
The effect: this report could answer PASS at a tip while the queue refused the
same tip for a standing request. The rows are now built once, by an exported
reportsFrom, so the drift is visible to a test instead of only to a diff.What changed
.github/scripts/review-gate.mjs—reportsFrom({ comments, reviews, reviewComments })builds all three faces (comment, review withstate, andkind: 'review-comment'for a diff-line comment whose body is not blank);main()uses it and passes only the conclusion faces todecide.isConclusionSourcemoved here fromenqueue-rules.mjs, whichre-exports it, so the guard and
merge-gate.mjskeep their import. It is onedefinition, not a second copy: importing it the other way would have made an
import cycle (
enqueue-rules.mjsalready importsparseReportfrom thisfile), and gate code should not have one.
.github/scripts/review-gate.test.mjs— four tests on GitHub-API-shapedfixtures.
The three row builders stay in three places on purpose: collapsing them is a
separate change with its own equivalence test ("same fixture, three readers,
byte-identical output"), and merging it here would hide the drift instead of
pinning it.
Red first, then green
review-gate.mjs:SyntaxError: The requested module './review-gate.mjs' does not provide an export named 'isConclusionSource'→# tests 1 / # pass 0 / # fail 1,twice.
id, nostate, emptyreviews filtered out, no review-comment rows — behaviour identical to base):
# tests 68 / # pass 68 / # fail 0;# tests 72 / # pass 68 / # fail 4, exactly thefour new tests, including
+ actual: 0 / - expected: 1for the kept row andexpected: 'asked for changes'for the stop request.# tests 72 / # pass 72 / # fail 0, twice; the branchcarries no throwaway edit. Neighbour suites
enqueue-guard(155/155),merge-gate(52/52) andreview-verdict(11/11) stay green with there-export.
Verify
TZ=UTC npm run verifyat this commit: core lint 0 errors, plugin lint 0errors,
10 patches apply cleanly,core/ equals ds-bot/ + patches/ds-bot/,canonical no-op; the
.github+policysuite is679 tests / 678 pass / 1 fail— the one red is the known#749machine item, which names only thishost's
.cache/wt-2547/**worktree and not any file of this change;arch-docs: OK (3 changed file(s)).No changelog fragment: gate plumbing, nothing a user sees.
Fixes #2870
Owner: Dev-5
Reviewer: Birfy
Written-by: Dev-5
Bot: Dev-5
Claim-Id: 9b6bdf22f96041bb8c08334b5d1f7310
Risk tier: T3 (judge:
.github/scripts/enqueue-rules.mjs=T3, .github/scripts/review-gate.mjs=T3, .github/scripts/review-gate.test.mjs=T3)Base: 0b77add
{
"pr": 2875,
"claim": "Dev-5",
"issue": 2870,
"summary": "review-gate built its reports rows in a third copy that had drifted from the guard and the queue gate: no id, no review state, empty-body reviews dropped, no diff-line comments. reportsFrom now builds all three faces once and the conclusion readers skip the review-comment kind through one predicate. A CHANGES_REQUESTED review with an empty body is now visible as a stop request instead of the report answering PASS. The three builders stay separate; collapsing them is its own change.",
"files": [
".github/scripts/review-gate.mjs",
".github/scripts/enqueue-rules.mjs",
".github/scripts/review-gate.test.mjs"
],
"checks": {
"ran": "TZ=UTC npm run verify; ARCH_DOCS_BASE=0b77addc07 npm --prefix core run arch-docs; review-gate/enqueue-guard/merge-gate/review-verdict suites",
"result": "green",
"at": "763e15078270c128dd5302f76a932c2eecf91e15"
},
"next": "waiting for a PASS at this tip (T3); the three-builder merge stays a separate issue"
}